﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GISCore.Geometry
{
    [Serializable]
    public class IntersectPoint : Point
    {
        // If this intersect point has been visited? This flag is used in the polygon reconstruction phase.
        private bool _isVisited = false; 

        public Line inComingLine { get; set; }
        public Line outGoingLine { get; set; }
        public LinkedPoint inComing{get;set;}
        public LinkedPoint outGoing{get;set;}
        public LinkedPoint inNext { get; set; }
        public LinkedPoint outNext { get; set; }
       
        //constructor
        public IntersectPoint(double x, double y)
            : base(x, y)
        {

        }        
         
        //transfer from one list to the other list
        public LinkedPoint transfer(LinkedPoint currentPoint)
        {
            if (currentPoint == this.inComing)
            {
                return this.outGoing;
            }
            else
            {
                return this.inComing;
            }
        }

        //getter and setter

        public bool ifVisited()
        {
            return _isVisited;
        }
        public void hasVisited(bool flag)
        {
            this._isVisited = flag;
        }
    }
}
